# 定义医生类
# 包含属性：医师号，姓名，职称，年龄，性别
class Doctor:
    def __init__(self, doctor_id: str, name: str, position: str, age: str, gender: str, doctor_password: str):
        self._doctor_id = doctor_id
        self._name = name
        self._position = position
        self._age = age
        self._gender = gender
        self._doctor_password = doctor_password

    @property
    def doctor_id(self) -> str:
        """获取医生医师号"""
        return self._doctor_id

    @doctor_id.setter
    def doctor_id(self, doctor_id: str):
        """设置医生医师号"""
        if not isinstance(doctor_id, str) or len(doctor_id) != 8:
            raise ValueError("医师号必须是8位的字符串")
        self._doctor_id = doctor_id

    @property
    def name(self) -> str:
        """获取医生姓名"""
        return self._name

    @name.setter
    def name(self, name: str):
        """设置医生姓名"""
        if not isinstance(name, str):
            raise ValueError("姓名必须是字符串")
        self._name = name

    @property
    def position(self) -> str:
        """获取医生职称"""
        return self._position

    @position.setter
    def position(self, position: str):
        """设置医生职称"""
        if not isinstance(position, str):
            raise ValueError("职称必须是字符串")
        self._position = position

    @property
    def age(self) -> str:
        """获取医生年龄"""
        return self._age

    @age.setter
    def age(self, age: str):
        """设置医生年龄"""
        if not isinstance(int(age), int) or int(age) < 0:
            raise ValueError("年龄必须是非负整数")
        self._age = age

    @property
    def gender(self) -> str:
        """获取医生性别"""
        return self._gender

    @gender.setter
    def gender(self, gender: str):
        """设置医生性别"""
        if gender not in ['男', '女']:
            raise ValueError("性别必须是'男'或'女'")
        self._gender = gender

    @property
    def doctor_password(self) -> str:
        """获取医生医师号"""
        return self._doctor_password

    @doctor_password.setter
    def doctor_password(self, doctor_password: str):
        """设置医生医师号"""
        if not isinstance(doctor_password, str):
            raise ValueError("密码必须是字符串")
        self._doctor_password = doctor_password

    def get_info(self) -> str:
        """获取医生信息的字符串表示"""
        return f"医生姓名：{self._name}，医师号：{self._doctor_id}，职称：{self._position}，年龄：{self._age}，性别：{self._gender},密码：{self._doctor_password}"

    def print_info(self):
        """打印医生信息"""
        print(
            f"医生姓名：{self._name}，医师号：{self._doctor_id}，职称：{self._position}，年龄：{self._age}，性别：{self._gender},密码：{self._doctor_password}")
